# A plotting R script produced by the REVIGO server at http://revigo.irb.hr/ # If you found REVIGO useful in your work, please cite the following reference: # Supek F et al. "REVIGO summarizes and visualizes long lists of Gene Ontology # terms" PLoS ONE 2011. doi:10.1371/journal.pone.0021800 # -------------------------------------------------------------------------- # If you don't have the ggplot2 package installed, uncomment the following line: # install.packages ("ggplot2"); library (ggplot2); # -------------------------------------------------------------------------- # Here is your data from REVIGO. Scroll down for plot configuration options. revigo.names <- c("term_ID","description","frequency_%","plot_X","plot_Y","plot_size","log10_p_value","uniqueness","dispensability"); revigo.data <- rbind(c("GO:0006066","alcohol metabolic process", 2.367, 2.724, 6.942, 5.431,-4.7595,0.909,0.000), c("GO:0009791","post-embryonic development", 0.098, 5.406,-1.936, 4.048,-1.4407,0.915,0.000), c("GO:0033036","macromolecule localization", 2.299,-6.569, 1.950, 5.418,-5.0074,0.812,0.000), c("GO:0034621","cellular macromolecular complex subunit organization", 0.883,-1.988, 7.780, 5.002,-6.1308,0.489,0.000), c("GO:0019748","secondary metabolic process", 0.081, 1.905, 0.934, 3.966,-1.6587,0.910,0.010), c("GO:0055114","oxidation-reduction process",16.676, 4.583, 4.544, 6.279,-7.6990,0.918,0.020), c("GO:0030029","actin filament-based process", 0.106, 0.311,-3.674, 4.084,-5.2457,0.899,0.021), c("GO:0007017","microtubule-based process", 0.308,-1.436,-6.385, 4.546,-5.0048,0.897,0.023), c("GO:0006413","translational initiation", 0.337, 6.180, 1.617, 4.584,-5.2933,0.883,0.024), c("GO:0009056","catabolic process", 7.834, 3.326,-4.968, 5.951,-2.9177,0.912,0.025), c("GO:0044237","cellular metabolic process",56.715,-4.942,-5.253, 6.810,-1.6816,0.920,0.047), c("GO:0016192","vesicle-mediated transport", 0.348,-6.010, 3.076, 4.598,-3.5258,0.825,0.284), c("GO:0051649","establishment of localization in cell", 1.418,-5.303, 1.566, 5.208,-3.5129,0.797,0.333), c("GO:0051641","cellular localization", 1.510,-5.949, 0.385, 5.236,-3.7986,0.797,0.336), c("GO:0045184","establishment of protein localization", 1.781,-6.787, 0.975, 5.307,-4.4802,0.813,0.343), c("GO:0044087","regulation of cellular component biogenesis", 0.077,-1.355, 7.653, 3.943,-2.5373,0.589,0.481)); one.data <- data.frame(revigo.data); names(one.data) <- revigo.names; one.data <- one.data [(one.data$plot_X != "null" & one.data$plot_Y != "null"), ]; one.data$plot_X <- as.numeric( as.character(one.data$plot_X) ); one.data$plot_Y <- as.numeric( as.character(one.data$plot_Y) ); one.data$plot_size <- as.numeric( as.character(one.data$plot_size) ); one.data$log10_p_value <- as.numeric( as.character(one.data$log10_p_value) ); one.data$frequency <- as.numeric( as.character(one.data$frequency) ); one.data$uniqueness <- as.numeric( as.character(one.data$uniqueness) ); one.data$dispensability <- as.numeric( as.character(one.data$dispensability) ); #head(one.data); # -------------------------------------------------------------------------- # Names of the axes, sizes of the numbers and letters, names of the columns, # etc. can be changed below p1 <- ggplot( data = one.data ); p1 <- p1 + geom_point( aes( plot_X, plot_Y, colour = log10_p_value, size = plot_size), alpha = I(0.6) ) + scale_area(); p1 <- p1 + scale_colour_gradientn( colours = c("blue", "green", "yellow", "red"), limits = c( min(one.data$log10_p_value), 0) ); p1 <- p1 + geom_point( aes(plot_X, plot_Y, size = plot_size), shape = 21, fill = "transparent", colour = I (alpha ("black", 0.6) )) + scale_area(); p1 <- p1 + scale_size( range=c(5, 30)) + theme_bw(); # + scale_fill_gradientn(colours = heat_hcl(7), limits = c(-300, 0) ); ex <- one.data [ one.data$dispensability < 0.15, ]; p1 <- p1 + geom_text( data = ex, aes(plot_X, plot_Y, label = description), colour = I(alpha("black", 0.85)), size = 3 ); p1 <- p1 + labs (y = "semantic space x", x = "semantic space y"); p1 <- p1 + opts(legend.key = theme_blank()) ; one.x_range = max(one.data$plot_X) - min(one.data$plot_X); one.y_range = max(one.data$plot_Y) - min(one.data$plot_Y); p1 <- p1 + xlim(min(one.data$plot_X)-one.x_range/10,max(one.data$plot_X)+one.x_range/10); p1 <- p1 + ylim(min(one.data$plot_Y)-one.y_range/10,max(one.data$plot_Y)+one.y_range/10); # -------------------------------------------------------------------------- # Output the plot to screen p1; # Uncomment the line below to also save the plot to a file. # The file type depends on the extension (default=pdf). # ggsave("C:/Users/path_to_your_file/revigo-plot.pdf");